Skip to content

Conversation

@chezsmithy
Copy link
Contributor

@chezsmithy chezsmithy commented Oct 21, 2025

Description

Noticed the CLI and Core "Tool" type had a misaslignment around how a function was defined. This change aligns the function defintion making it easier to share tools between core and the cli. Also eliminates potential issues in the OpenAPI adapters when using tools between core and the cli.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

Updated tests as needed.


Summary by cubic

Refactors the CLI Tool type to use a function schema (type: "function" with function {name, description, parameters}), aligning with core and preventing mismatches. Also improves required-arg validation, permission handling, and error handling to prevent runtime errors.

  • Refactors

    • Tool type now: type "function" with a function object holding name, description, and parameters.
    • Updated all built-in tools, MCP tool conversion, permission checks, and tool discovery to use function.name/function.parameters.
    • Fixed required-arg validation to check function.parameters.properties; added null safety in permission checker.
    • Tools now throw structured errors (ContinueError) instead of returning error strings; updated stream helpers, editors, and tests.
    • Headless mode excludes "ask" permission tools; agent-based runs default to allow all tools when not specified.
  • Migration

    • Update custom CLI tools to include type: "function" and move name/description/parameters into tool.function.
    • Replace references to tool.name/description/parameters with tool.function.name/description/parameters.
    • Ensure allowlists/filters use function.name.

Written for commit ff386a8. Summary will update automatically on new commits.

@chezsmithy chezsmithy requested a review from a team as a code owner October 21, 2025 19:11
@chezsmithy chezsmithy requested review from tingwai and removed request for a team October 21, 2025 19:11
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 21, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 21 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="extensions/cli/src/tools/index.tsx">

<violation number="1" location="extensions/cli/src/tools/index.tsx:253">
Iterating over the schema object means you only ever see keys like &quot;type&quot; and &quot;properties&quot;, so required argument names are never checked. Please iterate over `tool.function.parameters.properties` instead.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Oct 25, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 20 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="extensions/cli/src/stream/streamChatResponse.helpers.ts">

<violation number="1" location="extensions/cli/src/stream/streamChatResponse.helpers.ts:313">
Moving getAllAvailableTools() outside the per-tool try/catch means any setup failure (e.g., model service not initialized) now rejects preprocessStreamedToolCalls entirely instead of producing a handled tool error. Please restore the await inside the try so thrown errors are caught and reported.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

// Get all available tools

// Get all available tools
const availableTools: Tool[] = await getAllAvailableTools(isHeadless);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving getAllAvailableTools() outside the per-tool try/catch means any setup failure (e.g., model service not initialized) now rejects preprocessStreamedToolCalls entirely instead of producing a handled tool error. Please restore the await inside the try so thrown errors are caught and reported.

Prompt for AI agents
Address the following comment on extensions/cli/src/stream/streamChatResponse.helpers.ts at line 313:

<comment>Moving getAllAvailableTools() outside the per-tool try/catch means any setup failure (e.g., model service not initialized) now rejects preprocessStreamedToolCalls entirely instead of producing a handled tool error. Please restore the await inside the try so thrown errors are caught and reported.</comment>

<file context>
@@ -309,12 +309,16 @@ export async function preprocessStreamedToolCalls(
   // Get all available tools
 
+  // Get all available tools
+  const availableTools: Tool[] = await getAllAvailableTools(isHeadless);
+
   // Process each tool call
</file context>

✅ Addressed in a8f6c10

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Nov 2, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

chezsmithy and others added 16 commits November 1, 2025 18:52
- Fixed validateToolCallArgsPresent to iterate over tool.function.parameters.properties
- Previously iterated over schema object keys like 'type' and 'properties'
- Now correctly validates actual parameter names against required arguments
- Added null safety with ?? {} fallback for undefined properties

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Fixed formatting in searchCode.ts and writeChecklist.test.ts
- Ensures code style compliance with project standards

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Fix incorrect direct property access on Tool objects
- Update all tool references to use tool.function.name instead of tool.name
- Update tool property access to use tool.function.description and tool.function.parameters
- Fix convertMcpToolToContinueTool to return proper Tool structure with function property
- Resolve TypeScript errors across CLI tool handling components

Affected files:
- extensions/cli/src/tools/index.tsx
- extensions/cli/src/permissions/permissionChecker.ts
- extensions/cli/src/services/ToolPermissionService.ts
- extensions/cli/src/stream/handleToolCalls.ts
- extensions/cli/src/stream/streamChatResponse.helpers.ts
- Add optional chaining to safely access tool.function.name property
- Fix mock tool structure in tests to match real tool interface
- Resolves TypeError: Cannot read properties of undefined (reading 'name')
- All 126 permission tests now pass

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Add optional chaining to safely access t.function?.name in ToolPermissionService
- Add additional null check to filter out undefined names
- Prevents TypeError when accessing function property on tools
- Ensures robustness when working with tool collections
- All 64 ToolPermissionService tests passing

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Comprehensive guide for using Atlassian Rovo MCP with Continue
- Covers Jira, Confluence, and Compass workflows
- Includes natural language examples for TUI and headless modes
- Provides GitHub Actions automation examples
- Documents OAuth setup, troubleshooting, and admin considerations

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Added to Cookbooks section in docs.json
- Added to MCP Integration Cookbooks in guides/overview.mdx
- Positioned after GitHub MCP cookbook for logical flow

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Changed quick start to use continuedev/atlassian-continuous-ai-confluence-agent
- Updated all headless mode examples to use --agent flag instead of --config/-p
- Simplified first command to show direct agent invocation
- Updated GitHub Actions examples to use the agent URL
- Removed --auto flag as it's implicit with direct command format

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Major changes:
- Split Quick Start into two tabs: Jira Agent and Confluence Agent
- Added Agent Quick Reference table for easy comparison
- Updated all Jira workflow examples to use the Jira agent
- Kept all Confluence workflow examples with the Confluence agent
- Updated Compass workflows to use Jira agent (component-focused)
- Added guidance notes for cross-product workflows
- Included shell alias tips for both agents
- Updated GitHub Actions examples to use appropriate agents

All workflow examples now use the correct specialized agent:
- Jira Agent: continuedev/atlassian-continuous-ai-jira-agent
- Confluence Agent: continuedev/atlassian-continuous-ai-confluence-agent

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Updated cross-product workflows note to include custom agent option
- Added link to Atlassian MCP on Continue Hub
- Clarifies that users can create their own agents with the MCP

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Major improvements:
- Changed from Cards to AccordionGroups for better scanability
- Removed dual TUI/headless examples - now showing single command format
- Added Info callouts explaining headless mode: add -p flag and --auto
- Emphasized OAuth authentication requirement before headless mode
- Simplified all examples to show direct command format
- Added inline comments in combined workflows to clarify agent choice
- Reduced redundancy and improved readability

The accordion format is more compact and easier to scan through multiple examples.

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Removed entire GitHub Actions automation section
- Removed example workflows (sprint summary and doc sync)
- Updated What You've Built section to remove automation reference
- Updated Next Steps to remove GitHub Actions setup step
- Simplified focus to interactive and headless CLI usage

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Updated the Two Specialized Agents callout to emphasize:
- These are ready-to-use agents to help users get started fast
- Pre-configured with optimized prompts, rules, and Atlassian MCP
- Users don't have to use them, but they provide the best experience
- Users can create their own custom agents instead

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
* fix: show md rules and prompts in respective sections

* Update core/config/markdown/loadMarkdownRules.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Revert "Update core/config/markdown/loadMarkdownRules.ts"

This reverts commit cf0faba.

* Revert "fix: show md rules and prompts in respective sections"

This reverts commit b19726b.

* fix: skip invokable prompt files

also read .md files from prompt folders

* remove debug statements

* simplify if block

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
sestinj and others added 23 commits November 1, 2025 18:58
….mdx

- Replace markdown bullet list with CardGroup and Card components
- Add appropriate icons for each cookbook (book, github, atlassian, chart-line, globe, gauge, database, bug, shield, pipe)
- Set cols={2} for two-column layout
- Preserve all descriptions and links

Fixes CON-4547

Co-authored-by: Username <[email protected]>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
- Add info callouts explaining tool permission levels (allow/ask/exclude)
- Document differences between TUI and headless mode tool availability
- Clarify that 'ask' permission tools are excluded in headless mode
- Provide guidance on choosing between TUI and headless modes
- Reference PR continuedev#8416 implementation

Fixes CON-4622

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Co-authored-by: Username <[email protected]>
Replaces outdated discord.gg/continue vanity link with discord.gg/vapESyrFmJ
for consistency with other documentation files.

Fixes continuedev#8448
…ignature

- Add environment variable check in systemMessage.ts
- Update README.md with documentation
- Allows users to disable the Continue commit signature in generated commits
* feat: add GPT-5 Codex model support

- Add GPT-5 Codex to llm-info package with 500k context and 150k max tokens
- Add model definition to models.ts for UI configuration
- Include GPT-5 Codex in OpenAI provider packages list
- Model supports chat and edit roles with tool_use capability

* feat: impl Responses API in oai-adapters

* fix chat describer

* Update openai.ts

* fix llm-info

* address dallin's feedback
Added an Info callout to the Local Models section in /customization/models
that directs users to the Ollama setup guide for a quick walkthrough.

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Co-authored-by: bekah-hawrot-weigel <[email protected]>
)

* feat: Use the correct FIM template for Granite 4 models

Branch: GraniteFourTemplates

Signed-off-by: Gabe Goodhart <[email protected]>

* feat: Add granite4 name variants to the list of models that natively support tools

Branch: GraniteFourTemplates

Signed-off-by: Gabe Goodhart <[email protected]>

---------

Signed-off-by: Gabe Goodhart <[email protected]>
Remove @continue.dev filter for account level MCPs

- Made remote sessions (account-level MCPs) generally available to all authenticated users
- Removed email domain restriction from shouldEnableRemoteSessions() and listRemoteSessions() in ControlPlaneClient
- Removed email domain restriction from getRemoteSessions() in CLI session management

Generated with [Continue](https://continue.dev)

Co-authored-by: continue[bot] <continue[bot]@users.noreply.github.com>
Co-authored-by: Continue <[email protected]>
Co-authored-by: Nate <[email protected]>
…t.ts

- Replace t.name with t.function?.name for tool name access
- Add .filter(Boolean) to remove any undefined names from the array
- Ensures consistent tool name access pattern across all test files
- All 18 agent file integration tests now pass
- Maintains consistency with other permission service fixes

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
@chezsmithy chezsmithy force-pushed the refactor-cli-Tool-type branch from ca9e5a2 to ff386a8 Compare November 2, 2025 02:04
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 2, 2025
@chezsmithy chezsmithy closed this Nov 2, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Nov 2, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2025
@chezsmithy chezsmithy deleted the refactor-cli-Tool-type branch November 2, 2025 05:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.